<?php


namespace app\admin\validate;


use think\Validate;

class AdminUser extends Validate
{
    protected $rule = [
        'username' => 'require',
        'password' => 'require',
        'id' => 'require',
        'name' => 'require|unique:admin',
        'name_two' => 'require',
        'roleName' => 'require',
        'rule' => 'require',
    ];
    protected $message = [
        'username' => '用户名必须',
        'password' => '密码必须',
        'id' => 'id不能为空',
        'name' => '账号必须',
        'name_two' => '账号必须',
        'name.unique' => '账号不能重复',
        'roleName' => '角色不能为空',
        'rule' => '先设置权限'
    ];
    protected $scene = [
        'admin_add'=>['name','roleName','rule','password'],
        'admin_edit'=>['name_two','roleName','rule','id'],
        'admin_password'=>['password','id'],
    ];
    
}